package com.platform.dao.mybatis.impl;

import com.platform.domain.model.RoleAuthorizationKey;
import com.platform.dao.RoleAuthorizationDao;
import com.platform.dao.mybatis.mapper.RoleAuthorizationMapper;
import com.platform.domain.model.RoleAuthorization;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


/**
* RoleAuthorization
*
* User: wangyang
* DateTime: 2012-10-08 16:11:49
*
*/
@Service("roleAuthorizationDao")
public class RoleAuthorizationDaoImpl implements RoleAuthorizationDao {

    @Resource
    private RoleAuthorizationMapper roleAuthorizationMapper;

    /**
    *
    * 根据主键查询RoleAuthorization对象
    *
    * @param key
    * @return RoleAuthorization对象
    */
    @Override
    public RoleAuthorization selectByPrimaryKey(RoleAuthorizationKey key) throws Exception {
        return roleAuthorizationMapper.selectByPrimaryKey(key);
    }

    /**
    *
    * 根据查询条件查询符合条件的RoleAuthorization对象
    *
    * @param roleAuthorization
    * @return 符合条件的RoleAuthorization对象List
    */
    @Override
    public List<RoleAuthorization> select(RoleAuthorization roleAuthorization) throws Exception {
        return roleAuthorizationMapper.select(roleAuthorization);
    }

    /**
    *
    * 根据主键删除RoleAuthorization对象
    *
    * @param key
    * @return 影响条件数
    */
    @Override
    public int deleteByPrimaryKey(RoleAuthorizationKey key) throws Exception {
        return roleAuthorizationMapper.deleteByPrimaryKey(key);
    }

    /**
    *
    * 根据条件删除符合条件的RoleAuthorization对象
    *
    * @param roleAuthorization
    * @return 影响条件数
    */
    @Override
    public int delete(RoleAuthorization roleAuthorization) throws Exception {
        return roleAuthorizationMapper.delete(roleAuthorization);
    }

    /**
    *
    * 插入RoleAuthorization对象
    *
    * @param roleAuthorization
    * @return 影响条件数
    */
    @Override
    public int insert(RoleAuthorization roleAuthorization) throws Exception {
        return roleAuthorizationMapper.insert(roleAuthorization);
    }

    /**
     * 插入RoleAuthorization对象
     *
     * @param roleAuthorization
     * @return 影响条件数
     */
    @Override
    public int insertByFunSp(RoleAuthorization roleAuthorization) throws Exception {
        return roleAuthorizationMapper.insertByFunSp(roleAuthorization);
    }

    /**
    *
    * 更新RoleAuthorization对象
    *
    * @param roleAuthorization
    * @return 影响条件数
    */
    @Override
    public int update(RoleAuthorization roleAuthorization) throws Exception {
        return roleAuthorizationMapper.update(roleAuthorization);
    }
}
